﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 单例模式_菜单事件判断防多开
{
    public partial class Form1 : Form
    {
        private frmToolBox ftb;

        public Form1()
        {
            InitializeComponent();
        }

        private void 工具栏ToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
            if (ftb == null)
            {
                ftb = new frmToolBox();
                ftb.TopLevel = false; //不加就变成顶级，无法添加
                ftb.Parent = this;
                ftb.Show();
            }
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {

        }
    }
}